package org.gc.service.security;

import javax.annotation.PostConstruct;

import org.gc.common.entity.security.Role;
import org.gc.common.vo.security.RoleVO;
import org.gc.dao.security.RoleDao;
import org.gc.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class RoleServiceImpl extends BaseServiceImpl<Role, RoleVO, Long> implements RoleService {
    private RoleDao roleDao;
    
    public RoleServiceImpl(){
        super.setBaseDao(roleDao);
    }
    @Autowired
    public void setRoleDao(RoleDao roleDao) {
        this.roleDao = roleDao;
    }
    @PostConstruct
    public void afterConstruct(){
        super.setBaseDao(roleDao);
        super.setEntityClass(Role.class);
        super.setEntityVOClass(RoleVO.class);
    }

    public RoleVO getRole(String rolename) {
        return super.getBy("name", rolename);
    }

}
